﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;
using XCode.Configuration;
using XCode.DataAccessLayer;
namespace BingZi.HY.Core
{




    /// <summary>应用表</summary>
    [Serializable]
    [DataObject]
    [Description("应用表")]
    [BindIndex("PK_SYS_APPLICATIONS", true, "ApplicationID")]
    [BindTable("sys_Applications", Description = "应用表", ConnName = "System")]
    public partial class sys_Applications<TEntity> : Isys_Applications
    {
        #region 属性
        private Int32 _ApplicationID;
        /// <summary>自动ID 1:为系统管理应用</summary>
        [DisplayName("自动ID 1:为系统管理应用")]
        [Description("自动ID 1:为系统管理应用")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn(1, "ApplicationID", "自动ID 1:为系统管理应用", null, "int", 10, 0, false)]
        public Int32 ApplicationID
        {
            get { return _ApplicationID; }
            set { if (OnPropertyChanging("ApplicationID", value)) { _ApplicationID = value; OnPropertyChanged("ApplicationID"); } }
        }

        private String _A_AppName;
        /// <summary>应用名称</summary>
        [DisplayName("应用名称")]
        [Description("应用名称")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(2, "A_AppName", "应用名称", null, "nvarchar(50)", 0, 0, true)]
        public String A_AppName
        {
            get { return _A_AppName; }
            set { if (OnPropertyChanging("A_AppName", value)) { _A_AppName = value; OnPropertyChanged("A_AppName"); } }
        }

        private String _A_AppDescription;
        /// <summary>应用介绍</summary>
        [DisplayName("应用介绍")]
        [Description("应用介绍")]
        [DataObjectField(false, false, true, 200)]
        [BindColumn(3, "A_AppDescription", "应用介绍", null, "nvarchar(200)", 0, 0, true)]
        public String A_AppDescription
        {
            get { return _A_AppDescription; }
            set { if (OnPropertyChanging("A_AppDescription", value)) { _A_AppDescription = value; OnPropertyChanged("A_AppDescription"); } }
        }

        private String _A_AppUrl;
        /// <summary>应用Url地址</summary>
        [DisplayName("应用Url地址")]
        [Description("应用Url地址")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(4, "A_AppUrl", "应用Url地址", null, "varchar(50)", 0, 0, false)]
        public String A_AppUrl
        {
            get { return _A_AppUrl; }
            set { if (OnPropertyChanging("A_AppUrl", value)) { _A_AppUrl = value; OnPropertyChanged("A_AppUrl"); } }
        }

        private Int32 _A_Order;
        /// <summary>应用排序</summary>
        [DisplayName("应用排序")]
        [Description("应用排序")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(5, "A_Order", "应用排序", null, "int", 10, 0, false)]
        public Int32 A_Order
        {
            get { return _A_Order; }
            set { if (OnPropertyChanging("A_Order", value)) { _A_Order = value; OnPropertyChanged("A_Order"); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "ApplicationID": return _ApplicationID;
                    case "A_AppName": return _A_AppName;
                    case "A_AppDescription": return _A_AppDescription;
                    case "A_AppUrl": return _A_AppUrl;
                    case "A_Order": return _A_Order;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "ApplicationID": _ApplicationID = Convert.ToInt32(value); break;
                    case "A_AppName": _A_AppName = Convert.ToString(value); break;
                    case "A_AppDescription": _A_AppDescription = Convert.ToString(value); break;
                    case "A_AppUrl": _A_AppUrl = Convert.ToString(value); break;
                    case "A_Order": _A_Order = Convert.ToInt32(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得应用表字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>自动ID 1:为系统管理应用</summary>
            public static readonly FieldItem ApplicationID = Meta.Table.FindByName("ApplicationID");

            ///<summary>应用名称</summary>
            public static readonly FieldItem A_AppName = Meta.Table.FindByName("A_AppName");

            ///<summary>应用介绍</summary>
            public static readonly FieldItem A_AppDescription = Meta.Table.FindByName("A_AppDescription");

            ///<summary>应用Url地址</summary>
            public static readonly FieldItem A_AppUrl = Meta.Table.FindByName("A_AppUrl");

            ///<summary>应用排序</summary>
            public static readonly FieldItem A_Order = Meta.Table.FindByName("A_Order");
        }
        #endregion
    }

    /// <summary>应用表接口</summary>
    public partial interface Isys_Applications
    {
        #region 属性
        /// <summary>自动ID 1:为系统管理应用</summary>
        Int32 ApplicationID { get; set; }

        /// <summary>应用名称</summary>
        String A_AppName { get; set; }

        /// <summary>应用介绍</summary>
        String A_AppDescription { get; set; }

        /// <summary>应用Url地址</summary>
        String A_AppUrl { get; set; }

        /// <summary>应用排序</summary>
        Int32 A_Order { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}